﻿@model IEnumerable<ElCharro01.Models.Variant>
@{
    ViewBag.Title = "Index";
    Layout = "~/Views/Shared/_LayoutAdmin.cshtml";
}
<div class="paddalo">
    <h2 class="centered">
        Gestione Varianti</h2>
    <table>
        <tr>
            <th>
                Colore
            </th>
            <th>
                PrezzoUnitario ( € )
            </th>
            <th>
                Taglia
            </th>
            <th>
                InStock
            </th>
            <th>
                Variante Del Prodotto
            </th>
            <th>
                Immagine
            </th>
            <th>
            </th>
        </tr>
        @foreach (var item in Model)
        {
            <tr>
                <td>
                    @Html.DisplayFor(modelItem => item.Colore)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.PrezzoUnitario)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Taglia)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.InStock)
                </td>
                <td>
                    @Html.DisplayFor(modelItem => item.Product.Nome)
                </td>
                <td>
                    <a href="@Url.Action("Edit", "Variant", new { id = item.ID })">
                        <img widt="110" height="110" src="/Content/Images/Raw/@item.Image.First().Path" alt="@item.Product.Nome" />
                    </a>
                </td>
                <td>
                    @Html.ActionLink("Edit", "Edit", new { id = item.ID }) |
                    @Html.ActionLink("Elimina", "Delete", new { id = item.ID })
                </td>
            </tr>
        }
    </table>
</div>
